<template>
  <div class="home">
    <main>
      <router-view></router-view>
    </main>
    <van-tabbar v-model="active">
      <van-tabbar-item 
      :icon="item.meta.icon" 
      v-for="item in foot" 
      :key="item.name"
      :to="`/home/${item.path}`"
      >
      {{item.meta.title}}
      </van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  name: "Home",
  components: {
  }, data(){
        return{
          active:0,
            foot:[{
            path: 'homePage',
            name: 'HomePage',
            meta: {
                title: '首页',
                icon: 'wap-home-o'
            }
        }, {
            path: 'classify',
            name: 'Classify',
            meta: {
                title: '分类',
                icon: 'wap-home-o'
            }
        }, {
            path: 'food',
            name: 'Food',
            meta: {
                title: '吃什么',
                icon: 'wap-home-o'
            }
        }, {
            path: 'ShopCar',
            name: 'ShopCar',
            meta: {
                title: '购物车',
                icon: 'wap-home-o'
            }
        }, {
            path: 'myPage',
            name: 'MyPage',
            meta: {
                title: '我的',
                icon: 'wap-home-o'
            }
        }]
        }
    }
};
</script>
<style lang='scss'>
*{
  padding: 0;
  margin: 0;
  list-style: none;
  box-sizing: border-box;
}
html,body,#app,.home{
  width: 100%;
  height: 100%;
}
.home{
  display: flex;
  flex-direction: column;
  main{
    flex: 1;
    // overflow-y: scroll;
  }
  footer{
    width: 100%;
    height: 50px;
    background: #fcc;
  }
}
</style>